# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ManagedIdentities.V1.Model.Peering do
  @moduledoc """
  Represents a Managed Service for Microsoft Active Directory Peering.

  ## Attributes

  *   `authorizedNetwork` (*type:* `String.t`, *default:* `nil`) - Required. The full names of the Google Compute Engine [networks](/compute/docs/networks-and-firewalls#networks) to which the instance is connected. Caller needs to make sure that CIDR subnets do not overlap between networks, else peering creation will fail.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the instance was created.
  *   `domainResource` (*type:* `String.t`, *default:* `nil`) - Required. Full domain resource path for the Managed AD Domain involved in peering. The resource path should be in the form: `projects/{project_id}/locations/global/domains/{domain_name}`
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Resource labels to represent user-provided metadata.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Unique name of the peering in this scope including projects and location using the form: `projects/{project_id}/locations/global/peerings/{peering_id}`.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of this Peering.
  *   `statusMessage` (*type:* `String.t`, *default:* `nil`) - Output only. Additional information about the current status of this peering, if available.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Last update time.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authorizedNetwork => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :domainResource => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :statusMessage => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:authorizedNetwork)
  field(:createTime, as: DateTime)
  field(:domainResource)
  field(:labels, type: :map)
  field(:name)
  field(:state)
  field(:statusMessage)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.ManagedIdentities.V1.Model.Peering do
  def decode(value, options) do
    GoogleApi.ManagedIdentities.V1.Model.Peering.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ManagedIdentities.V1.Model.Peering do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
